package com.zx.sdk.util;

import com.google.gson.Gson;

import java.lang.reflect.Type;

public class JsonHelper {
    private final static Gson mGson = new Gson();

    public static <T> T from(String json, Class<T> classOfT) {
        return mGson.fromJson(json, classOfT);
    }

    public static <T> T from(String json, Type type) {
        return mGson.fromJson(json, type);
    }

    public static String toJson(Object obj) {
        return mGson.toJson(obj);
    }
}
